package com.jihui.jihuipicturebackend.common;

import com.jihui.jihuipicturebackend.exception.ErrorCode;
import lombok.Data;

/**
 * @author jihui
 * @date 2024/12/24 23:00
 */
@Data
public class BaseResponse<T> implements java.io.Serializable {

        private int code;

        private T data;

        private String message;

        public BaseResponse(int code, T data, String message) {
            this.code = code;
            this.data = data;
            this.message = message;
        }

        public BaseResponse(int code, T data) {
            this(code, data, "");
        }

        public BaseResponse(ErrorCode errorCode) {
            this(errorCode.getCode(), null, errorCode.getMessage());
        }


}
